/*
Copyright 2008, 2009 Joonas Lehtolahti

This file is part of Openfire-C.

Openfire-C is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Openfire-C is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Openfire-C.  If not, see <http://www.gnu.org/licenses/>.
*/

int XfireAnalyze_hHeartbeat(XFINST inst, struct XfirePacket *packet) {
	/* Server's response to heartbeat message
	 * http://xfireplus.com/xfwiki/index.php/Packet_90_00
	 */
	unsigned int retval = XFIH_HANDLED;
	
	/* define external handler function type and calling parameters */
	#define _XFABT unsigned int
	#define _XFABP *result_value
	
	unsigned int *result_value = XfirePacketGetIntegerAttribute(packet, (unsigned const char *)"value");
	
	if (result_value) {
		/* include external handlers calling */
		#include "XfirePacketAnalyzeExt.inc"
		
		/* no internal handling required */
	}
	else {
		/* Not all attributes found */
		retval = XFIH_UNKNOWN;
	}
	/* Nothing to clear up */
	
	return retval;
}

